/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

import { UserStatus } from '../const';

@Serializable()
export class UserStatusConfig {
  @JsonProperty('status')
    status: number = UserStatus.Normal;

  @JsonProperty('userId')
    userId: number = 0;

  get body() {
    return {
      status: this.status,
      userId: this.userId,
    };
  }

  get clearBody() {
    return {
      userId: this.userId,
    };
  }
}

@Serializable()
export class UserFreezeConfig {
  @JsonProperty('userId')
    userId: number = 0;

  @JsonProperty('freezeTime')
    freezeTime: number = 0;

  get body() {
    return {
      userId: this.userId,
      freezeTime: +this.freezeTime,
    };
  }
}

@Serializable()
export default class UserItem {
  @JsonProperty('userId')
    userId: number = 0;

  @JsonProperty('nickName')
    nickName: string = '';

  @JsonProperty('email')
    email: string = '';

  @JsonProperty('phonenumber')
    phonenumber: string = '';

  @JsonProperty('userName')
    userName: string = '';

  @JsonProperty('sex')
    sex: string = '';

  @JsonProperty('avatar')
    avatar: string = '';

  @JsonProperty('realFlag')
    realFlag: number = 0;

  @JsonProperty('superFlag')
    superFlag: number = 0;

  @JsonProperty('realId')
    realId: string = '';

  @JsonProperty('realName')
    realName: string = '';

  @JsonProperty('inviteCode')
    inviteCode: string = '';

  @JsonProperty('balance')
    balance: number = 0;

  @JsonProperty('freezeBalance')
    freezeBalance: number = 0;

  @JsonProperty('freezeTime')
    freezeTime: number = 0;

  @JsonProperty('wechatOpenId')
    wechatOpenId: string = '';

  @JsonProperty('status')
    status: string = '';
}
